<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>租女友</title>
    <link crossorigin="anonymous" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" href="//lib.baomitu.com/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="app" class="container-fluid no-margin no-padding">
    <img src="./images/background.jpg" id="background">
        <div class="title">
        <div id="hireTitle">
            <h1>租女友</h1>
            <p>{{subtitle.one}}</p>
            <p>{{subtitle.two}}</p>
        </div>
    </div>
    <div class="tips">
        <h2>{{tips}}</h2>
        <div class="text">
            <p>{{content.one}}</p>
            <p>{{content.two}}</p>
            <p>{{content.three}}</p>
        </div>
        <div class="last">
            <p>{{last.one}}</p>
            <p>{{last.two}}</p>
        </div>
    </div>
    <a id="install" href="javascript:void(0);">点击安装</a>
</div>

<!--<script src="js/index.js"></script>-->

<script crossorigin="anonymous" integrity="sha384-8t+aLluUVnn5SPPG/NbeZCH6TWIvaXIm/gDbutRvtEeElzxxWaZN+G/ZIEdI/f+y" src="//lib.baomitu.com/vue/2.6.10/vue.min.js"></script>
<script crossorigin="anonymous" integrity="sha384-rY/jv8mMhqDabXSo+UCggqKtdmBfd3qC2/KvyTDNQ6PcUJXaxK1tMepoQda4g5vB" src="//lib.baomitu.com/jquery/2.2.4/jquery.min.js"></script>
<script>
    var vm = new Vue({
        el:"#app",
        data:{
            screenHeight:"",
            background:{
                backgroundImage:"url('./images/background.jpg')",
                backgroundRepeat:"no-repeat",
                backgroundSize:"cover",
                backgroundPosition:"center"
            },
            subtitle:{
                one:"租个女友带回家",
                two:"让生活变得更加有趣!"
            },
            tips:"温馨小提示",
            content:{
                one:"1.用户实名认证，确保双方安全",
                two:"2.记录出行轨迹，轨迹异常将自动练习紧急联系人",
                three:"3.遇到危险用户可一键定位，一键报警，即锁定违法用户",
            },
            last:{
               one:"平台不会透露用户的任何信息，租女友担心被知道？也可匿名交友哦！",
               two:"请勿通过线下出行，线下出行出现勒索绑架等意外情况平台不承担任何责任！"
            }
        },
        created(){
            this.screenHeight = window.screen.height;
        }
    });

    function is_weixin() {
        var ua = navigator.userAgent.toLowerCase();
        return ua.match(/MicroMessenger/i) == "micromessenger";
    }

    var isWeixin = is_weixin();
    var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
    function loadHtml(){
        var div = document.createElement('div');
        div.id = 'weixin-tip';
        div.innerHTML = '<p><img src="./images/live_weixin.png" alt="微信打开"/></p>';
        document.body.appendChild(div);
    }

    function loadStyleText(cssText) {
        var style = document.createElement('style');
        style.rel = 'stylesheet';
        style.type = 'text/css';
        try {
            style.appendChild(document.createTextNode(cssText));
        } catch (e) {
            style.styleSheet.cssText = cssText; //ie9以下
        }
        var head=document.getElementsByTagName("head")[0]; //head标签之间加上style样式
        head.appendChild(style);
    }

    var cssText = "#weixin-tip{position: fixed; left:0; top:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); width: 100%; height:100%; z-index: 100;} #weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}";
    $("#install").on("click",function () {
        if(isWeixin){
            loadHtml();
            loadStyleText(cssText);
            return false;
        }
        window.location.href="./apk/1-1563452192.apk";
    });
</script>
</body>
</html>